package com.fare.taluo.core.domain.crawl;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;

import com.dayatang.domain.InstanceFactory;
import com.fare.taluo.base.ddd.domain.baseentity.BaseEntity;

/**
 * 统计没有航班信息状态EXCLE信息表
 * @author admin
 *
 */

@javax.persistence.Table(name="fligth_status_info")
@javax.persistence.Entity
public class FligthStatusInfoEntity extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Column(name="title")
	private String title;
	
	@Column(name="createTime")
	private Date createTime=new Date();
	
	@Column(name="grabDate")
	private String grabDate;
	
	@Column(name ="path")
	private String path;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getGrabDate() {
		return grabDate;
	}

	public void setGrabDate(String grabDate) {
		this.grabDate = grabDate;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}
	
	public static FligthStatusInfoEntityRepository getEntityRepository() {
		return InstanceFactory.getInstance(FligthStatusInfoEntityRepository.class);
	}
	
	public void saveOrUpdateUserCareLineEntity(FligthStatusInfoEntity entity) {
		if(entity.getId() ==null || entity.getId() <=0){
			getEntityRepository().save(entity);
		}else{
			getEntityRepository().updateVo(entity);
		}
	}	
	
	public List<FligthStatusInfoEntity> findByGrabDate(String grabDateStr) {
		return getEntityRepository().findByCondition(grabDateStr);
	}
	
	public List<FligthStatusInfoEntity> findAll(){
		return getEntityRepository().findAll();
	}
}
